feat(async): Set priorities to async tasks#14195
Closed
kiblik wants to merge 10000 commits intoDefectDojo:devfrom
Closed
feat(async): Set priorities to async tasks#14195kiblik wants to merge 10000 commits intoDefectDojo:devfrom
kiblik wants to merge 10000 commits intoDefectDojo:devfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is adding support for priority queues. More important tasks will be processed sooner and vice versa.
The status of each queue is listed in the system settings overview:

Queue with id
0is automatically marked without a suffix (all other are using naming conventioncelery:1,celery:2...). Thanks to this fact, we are keeping backward compatibility (if there are any tasks in the queue during migration to the new version, we will still process those tasks after the upgrade).It is a bit harder to write tests for this. But I tested manually (stop worker, play around, start worker, observe logs) and it was working as expected.
The role of each queue is described in
settings.dist.py(and reflected in the overview in system settings). If task do not have a priority assigned, priority is set to the default value:3I'm open to feedback if priority of any task should be changed.